import config from "@/config"
import http from "@/utils/request"

export default {
	coupon: {
		list: {
			url: `${config.API_URL}coupon/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}coupon/create`,
			name: "添加",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		update: {
			url: `${config.API_URL}coupon/update`,
			name: "修改",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		delete: {
			url: `${config.API_URL}coupon/delete`,
			name: "删除",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		couponMemberList: {
			url: `${config.API_URL}couponMember/index`,
			name: "用户优惠券列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		couponMemberCreate: {
			url: `${config.API_URL}couponMember/create`,
			name: "发送优惠券",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
	},
	tools: {
		pageToUrl: {
			url: `${config.API_URL}tool/pageToUrl`,
			name: "小程序转网址",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	},
	alert: {
		list: {
			url: `${config.API_URL}alert/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}alert/create`,
			name: "添加",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		update: {
			url: `${config.API_URL}alert/update`,
			name: "修改",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		delete: {
			url: `${config.API_URL}alert/delete`,
			name: "删除",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
	},
	MemberCard: {
		list: {
			url: `${config.API_URL}MemberCard/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}MemberCard/create`,
			name: "添加",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		update: {
			url: `${config.API_URL}MemberCard/update`,
			name: "修改",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		changeStatus: {
			url: `${config.API_URL}MemberCard/changeStatus`,
			name: "修改卡片状态",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		delete: {
			url: `${config.API_URL}MemberCard/delete`,
			name: "删除",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
	},
	distribution: {
		index: {
			url: `${config.API_URL}Distribution/index`,
			name: "获取分销配置",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		update: {
			url: `${config.API_URL}Distribution/update`,
			name: "更新",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
	},
	workGroup: {
		list: {
			url: `${config.API_URL}workGroup/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
	},
	msgtsk: {
		list: {
			url: `${config.API_URL}msgtsk/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}msgtsk/create`,
			name: "添加",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		update: {
			url: `${config.API_URL}msgtsk/update`,
			name: "修改",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		// delete: {
		// 	url: `${config.API_URL}msgtsk/delete`,
		// 	name: "删除",
		// 	post: async function(data){
		// 		return await http.post(this.url, data, {
		// 		});
		// 	}
		// },
	},
	activity: {
		list: {
			url: `${config.API_URL}activity/index`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		detail: {
			url: `${config.API_URL}activity/read`,
			name: "列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}activity/create`,
			name: "添加",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		update: {
			url: `${config.API_URL}activity/edit`,
			name: "修改",
			post: async function(data){
				return await http.post(this.url, data, {
				});
			}
		},
		log: {
			url: `${config.API_URL}activity/log`,
			name: "抽奖记录",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		// delete: {
		// 	url: `${config.API_URL}msgtsk/delete`,
		// 	name: "删除",
		// 	post: async function(data){
		// 		return await http.post(this.url, data, {
		// 		});
		// 	}
		// },
	},
}
